/*----------------------------------------------------------------
 * Author:          Siqi Kang
 * Written:         02/10/2014
 * Last updated:    02/10/2014
 * 
 * The payment records the amount and other payment details within an order. 
 * 
 *----------------------------------------------------------------*/
package JavaSource;
import java.io.Serializable;
import java.util.*;
/**
 *
 * @author Siqi Kang
 * @version 1.0
 */
public class Payment implements Serializable,IdGenerable  {
   
   //Atributes
    private static int globalId=7000;
   private int receiptID;  //identifier for this receipt
   private double totalAmount;  //payment amount
   private Date date;  //used to record when this payment happened
   private int customerID;  

    public int getReceiptID() {
        return receiptID;
    }

    public void setReceiptID(int receiptID) {
        this.receiptID = receiptID;
    }

    public double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public static int getGlobalId() {
        return globalId;
    }

    public static void setGlobalId(int globalId) {
        Payment.globalId = globalId;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public int getCustomerID() {
        return customerID;
    }

    public void setCustomerID(int customerID) {
        this.customerID = customerID;
    }

    //Constructor
    
    public Payment( double totalAmount, Date date, int customerID)
    {
        this.receiptID = generateId();
        this.totalAmount = totalAmount;
        this.date = date;
        this.customerID = customerID;
    }
    
    //Method

    @Override
    public int generateId() {
       return ++globalId;
    }
    
   
   
    
    
}
